from fastapi import APIRouter
from backend.api.instance import router as instance_router

api_router_v1 = APIRouter()


def register_router(router: APIRouter, prefix: str, tags: list):
    """
    一个用于注册子路由的辅助函数。

    :param router: 要注册的子路由实例 (来自 dwf_instance.py, agent.py 等)
    :param prefix: 该组路由的 URL 前缀 (例如, "/instances")
    :param tags: 在 OpenAPI 文档中为这组路由指定的标签
    """
    api_router_v1.include_router(router, prefix=prefix, tags=tags)


register_router(instance_router, prefix="/instance", tags=["DWF Instances"])
